#include <stdio.h>

int main() {
	char x, y;
	scanf ("%c", &x);
	while (x != '\n') {
		if (x < 91 && x > 64)
			y = x + 32;
		else
		if (x < 123 && x > 96)
			y = x - 32;
		else
			y = x;
		
		printf("%c", y);
		scanf ("%c", &x);
	}
}
